<?php $baseUrl = Yii::app()->request->baseUrl ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link href="<?php echo $baseUrl; ?>/css/screen.css" rel="stylesheet" type="text/css" media="screen" />
        <link href="<?php echo $baseUrl; ?>/css/main.css" rel="stylesheet" type="text/css" media="screen" />
        <link href="<?php echo $baseUrl; ?>/css/form.css" rel="stylesheet" type="text/css" media="screen" />
        <link href="<?php echo $baseUrl; ?>/css/admin-style.css" rel="stylesheet" type="text/css" media="screen" />
        <title><?php echo CHtml::encode($this->pageTitle) ?></title>
    </head>
    <body>
        <!-- start header -->
        <div id="header">
            <div class="header-left">
                <?php echo CHtml::image($baseUrl . "/images/logo-normal.png", "logo", array('class' => 'logo')) ?>
                <p class="pagename">Site management</p>
            </div>
            <div class="header-right">
                <h3><?php echo CHtml::link('Logout(<span class="username">'.Yii::app()->user->getName().'</span>)', $baseUrl.'/admin.php/site/logout'); ?></h3>
            <?php echo CHtml::link(CHtml::image($baseUrl.'/images/preview-site.jpg', 'Preview',array('width'=>'100px')),$baseUrl.'/',array('target'=>'_blank','title'=>'Preview'));?></div>
        </div>
        <!-- end header -->
        <div class="nav">
            <table border="0" cellpadding="0" cellspacing="0" width="100%" height="35" style="padding: 0;">	
                <tbody><tr>
                        <td width="5" align="right"></td>
                        <td width="10" align="right" class="left-nav"></td>
                        <td width="60" align="left" class="mainNav navtd">
                            <a href="index.php?"><img src="<?php echo $baseUrl; ?>/images/home_bar.gif" alt="AMPPS Home"></a>
                        </td>

                        <td align="left" class="mainNav" >
                        </td>
                        <td align="right" class="mainNav" style="text-align: right;"> 
                            <?php if (Yii::app()->user->isGuest) {
					echo '<a href="'.Yii::app()->request->baseUrl.'/admin.php'.Yii::app()->user->loginUrl[0].'" >Login</a>';
				}
				else echo '<a href="'.Yii::app()->request->baseUrl.'/admin.php/site/logout">Logout('.Yii::app()->user->getName().')</a>';			
				?>
                        </td>	
                        <td width="10" align="left" class="right-nav"></td>
                        <td width="5" align="left">&nbsp;</td>
                    </tr>	
                </tbody>
            </table>
        </div>
            
        
        <!-- end menu -->
        <div id="page">
            <?php echo $content ?>
        </div>
        <!-- start footer -->
        <div id="footer">
            <p class="legal"> &copy;2013 Wicell Inc. All Rights Reserved.</p>

        </div>
        <!-- end footer -->
</html>
